package com.huawei.hms.framework.network.restclient.hwhttp.urlconnection;

import com.huawei.hms.framework.network.restclient.hwhttp.ClientConfiguration;
import com.huawei.hms.framework.network.restclient.hwhttp.HttpClient;
import com.huawei.hms.framework.network.restclient.hwhttp.RequestTask;
import com.huawei.hms.framework.network.restclient.hwhttp.RequestTask.Factory;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSocketFactory;

public class URLConnectionRequestTaskFactory implements Factory {
    private HttpClient httpClient;

    public URLConnectionRequestTaskFactory(HttpClient httpClient) {
        this.httpClient = httpClient;
    }

    public RequestTask newTask() {
        return new URLConnectionRequestTask(this);
    }

    public SSLSocketFactory getSslSocketFactory() {
        return this.httpClient.getSslSocketFactory();
    }

    public HostnameVerifier getHostnameVerifier() {
        return this.httpClient.getHostnameVerifier();
    }

    public int getConnectTimeout() {
        return this.httpClient.getConnectTimeout();
    }

    public ClientConfiguration getClientConfiguration() {
        return this.httpClient.getClientConfiguration();
    }

    public int getReadTimeout() {
        return this.httpClient.getReadTimeout();
    }
}
